function [fval,TEnonzero] = smm_eis15(param,dtarget,scaler)

    %Data moments (control means and weight matrices)
    DatM = dtarget{1,1};
    W = dtarget{2,1};
   
    %Simulated moments
    [E_S,~,~,~,~,TE_2]=smom_function_eis15(param);
    
    %Extract the relevant periods from employment rate moments
    E_Se = E_S(:,1); 
    TE_2e = TE_2;
    
    %Stack the level moments and the TEs, scale TE's by scaler
    SimM = [E_Se;scaler.*TE_2e];
    
    %SMM objective function
    m = SimM - DatM;
    fval = m'*W*m;

    %whether all TE estimates are zero
    TEnonzero = (sum(TE_2e)>0);
    
end

